﻿<%@ Page Language="C#" MasterPageFile="~/Shared/EOS.master" AutoEventWireup="True"
    Inherits="EOSCRM.Web.Forms.DanhMuc.KhuVuc" CodeBehind="KhuVuc.aspx.cs" %>

<%@ Import Namespace="EOSCRM.Web.Common"%>
<%@ Register Assembly="EOSCRM.Controls" Namespace="EOSCRM.Controls" TagPrefix="eoscrm" %>

<asp:Content ID="head" ContentPlaceHolderID="headCPH" runat="server">    
    <script type="text/javascript">
    </script>
</asp:Content>

<asp:Content ID="content" ContentPlaceHolderID="mainCPH" runat="server">    
    <asp:UpdatePanel ID="upnlInfor" UpdateMode="Conditional" runat="server">
        <ContentTemplate>
            <div class="crmcontainer">
                <table class="crmtable">
                    <tbody>
                        <tr>    
                            <td class="crmcell right">Mã khu vực</td>
                            <td class="crmcell"> 
                                <div class="left">
                                    <asp:TextBox ID="txtMaKV" runat="server" Width="165px" MaxLength="20" TabIndex="1" />
                                </div>
                            </td>                            
                        </tr>
                        <tr>    
                            <td class="crmcell right">Tên khu vực</td>
                            <td class="crmcell"> 
                                <div class="left">
                                    <asp:TextBox ID="txtTenKV" runat="server" Width="165px" MaxLength="100" 
                                        TabIndex="2" />
                                </div>
                            </td>
                        </tr>
                        <tr>    
                            <td class="crmcell right">Địa chỉ</td>
                            <td class="crmcell"> 
                                <div class="left">
                                    <asp:TextBox ID="txtDiaChi" runat="server" Width="165px" MaxLength="200" 
                                        TabIndex="3" />
                                </div>
                            </td>
                        </tr>

                        <tr>    
                            <td class="crmcell right">Tỉnh/ Thành</td>
                            <td class="crmcell"> 
                                <div class="left">
                                    <asp:DropDownList ID="ddlTinhThanh" runat="server" 
                                        AutoPostBack="true" Height ="25px" Width="177px" 
                                        onselectedindexchanged="ddlTinhThanh_SelectedIndexChanged1" TabIndex="4">
                                    </asp:DropDownList>                                    
                                </div>
                            </td>                            
                        </tr>

                        <tr>    
                            <td class="crmcell right">Huyện</td>
                            <td class="crmcell"> 
                                <div class="left">
                                    <asp:DropDownList ID="ddlHuyen" runat="server" 
                                         AutoPostBack="true" Height="25px" Width="177px" TabIndex="5">
                                    </asp:DropDownList>                                    
                                </div>
                            </td>                            
                        </tr>
                        
                        <tr>    
                            <td class="crmcell right"></td>
                            <td class="crmcell"> 
                                <div class="left">
                                    <eoscrm:Button ID="btnSave" OnClick="btnSave_Click" runat="server" CssClass="save" Text="" TabIndex="12" />
                                </div>   
                                <div class="left">
                                    <eoscrm:Button ID="btnDelete" runat="server" CssClass="delete"
                                        OnClick="btnDelete_Click" TabIndex="13" />
                                </div>
                                <div class="left">
                                    <eoscrm:Button ID="btnCancel" runat="server" CssClass="button_order" Text="Refresh"
                                        OnClick="btnCancel_Click" TabIndex="13" />
                                </div>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel> 
    <br />
    <asp:UpdatePanel ID="upnlGrid" UpdateMode="Conditional" runat="server">
        <ContentTemplate>
            <div class="crmcontainer">
                <eoscrm:Grid ID="gvList" runat="server" UseCustomPager="true" OnRowCommand="gvList_RowCommand" >
                    <PagerSettings FirstPageText="khu vực" PageButtonCount="2" />
                    <Columns>
                        <asp:TemplateField HeaderStyle-CssClass="checkbox">
                            <HeaderTemplate>
                                <input id="chkAllTop" title="Chọn hết / Bỏ chọn hết" name="chkAllTop" type="checkbox"
                                    onclick="CheckAllItems(this);" />
                            </HeaderTemplate>
                            <ItemTemplate>
                                <input id="Id" runat="server" type="hidden" value='<%# Eval("MaKhuVuc") %>' />
                                <input name="listIds" type="checkbox" value='<%# Eval("MaKhuVuc") %>' />
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Mã khu vực" HeaderStyle-Width="10%">
                            <ItemTemplate>
                                <asp:LinkButton ID="lnkBtnID" runat="server" CommandArgument='<%# Eval("MaKhuVuc") %>'
                                    CommandName="EditItem" Text='<%# Eval("MaKhuVuc") %>'></asp:LinkButton>
                            </ItemTemplate>
                            <ItemStyle Font-Bold="True" />
                        </asp:TemplateField>
                        <asp:BoundField HeaderText="Tên khu vực" DataField="TenKhuVuc" HeaderStyle-Width="28%" />
                        <asp:BoundField HeaderText="Địa chỉ" DataField="DiaChi" HeaderStyle-Width="58%" />
                        <asp:TemplateField HeaderText="Tỉnh/ Thành" HeaderStyle-Width="20%">
                            <ItemTemplate>
                                <asp:Label ID="lbtinh" runat="server" Text='<%# Eval("HUYEN1.TINHTHANH.TenTinh") %>' ></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Huyện" HeaderStyle-Width="20%">
                            <ItemTemplate>
                                <asp:Label ID="lbhuyen" runat="server" Text='<%# Eval("HUYEN1.TenHuyen") %>' ></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                </eoscrm:Grid>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
